package com.aids_malaria.adapter;


import android.content.Context;

import com.aids_malaria.R;
import com.aids_malaria.base.BaseQuickAdapter;
import com.aids_malaria.base.BaseViewHolder;
import com.aids_malaria.http.response.AreaV;

import java.util.List;

public class VillageDataCollectAdapter extends BaseQuickAdapter<AreaV> {

    public VillageDataCollectAdapter(Context context, int layoutResID, List<AreaV> data) {
        super(context, layoutResID, data);
    }

    @Override
    public void convert(BaseViewHolder holder, AreaV item) {
        if (holder.getAdapterPosition() % 2 > 0){
            holder.getView(R.id.item).setBackgroundColor(mContext.getResources().getColor(R.color.c_item2));
        }else {
            holder.getView(R.id.item).setBackgroundColor(mContext.getResources().getColor(R.color.c_item1));
        }
        holder.setText(R.id.tv_village_name,item.getVillage_name());
        holder.setText(R.id.tv_coordinate,item.getX() + "," + item.getY());
    }

}
